import 'package:baseproject/view/mine/mine.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class MyDrawer extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return new _MyDrawerState();
  }
}

class _MyDrawerState extends State<MyDrawer> {
  @override
  Widget build(BuildContext context) {
    return Drawer(
      child: MediaQuery.removePadding(
          context: context,
          removeTop: true,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Padding(
                  padding: const EdgeInsets.only(top: 38.0),
                  child: GestureDetector(
                    onTap: () {
                      Navigator.of(context).push(
                          new MaterialPageRoute(builder: (context) => Mine()));
                    },
                    child: Row(
                      children: <Widget>[
                        Padding(
                          padding: const EdgeInsets.symmetric(horizontal: 16.0),
                          child: ClipOval(
                            child: Image.asset(
                              "images/avatar.png",
                              width: 64,
                              height: 64,
                            ),
                          ),
                        ),
                        Text(
                          "光下的阴影",
                          style: TextStyle(fontWeight: FontWeight.bold),
                        )
                      ],
                    ),
                  )),
              Expanded(
                child: ListView(
                  children: <Widget>[
                    ListTile(
                      leading: const Icon(Icons.attach_money),
                      title: const Text('钱包'),
                      onTap: () {
                        print("点击钱包");
                      },
                    ),
                    ListTile(
                      leading: const Icon(Icons.broken_image),
                      title: const Text('技能'),
                    ),
                  ],
                ),
              ),
            ],
          )),
    );
  }
}
